package com.shtel.bss.saas.core.pub.convert;

import com.shtel.bss.saas.core.pub.util.DateUtils;
import org.springframework.util.StringUtils;

import java.util.Date;

/**
 * @Author jint
 * @Date 2020/2/7 16:09
 * @Version 1.0
 * @Description
 **/
public class EntityDtoTypeConvertor {
    public Date asDate(String date) {
        return DateUtils.jtDateFormat.parse(date);
    }
    public String asString(Date date) {
        if (date==null){
            return null;
        }
        return DateUtils.jtDateFormat.format(date);
    }


    public Long asLong(String str){
        if(StringUtils.isEmpty(str)){
            return null;
        }
        return Long.valueOf(str);
    }
}
